# import sys
#
#
#
# str = sys.stdin.readline()
#
# num = input("Enter a number: ")
# print(num)
#
# sys.stdout.write("Hello ")
# print('world')
#
# with open('a.txt', 'r', buffering=1,encoding='utf-8') as f:
# # \n换行符
#     print(f.read())
#     print(f.readline())# 读取一行
#     print(f.readlines())# 读取所有行,返回一个列表


# file = open('a.txt','r',buffering=1)
# print(file.read())
# file.close()

with open('a.txt','a',encoding='utf-8',buffering=1) as f:
    f.write('hello world')
#'a'向文件中追加写入数据
#'w'向文件中写入数据，覆盖原文件